#include "mystack.h"
#include "coordinate.h"



/**
int main(int argc, char const *argv[])
{
	MyStack *mystack = new MyStack(5);
	mystack->push('l');
	mystack->push('i');
	mystack->push('n');
	mystack->push('j');
	mystack->push('i');
	mystack->push('n');
	mystack->push('z');
	mystack->push('h');
	mystack->push('u');

	if (mystack->stackFull())
	{
		std::cout << "is full" << std::endl;
	}

	mystack->stackTraverse();

	char elem = 0;
	mystack->pop(elem);
	std::cout << elem << std::endl;
	std::cout << "length:" << mystack->stackLength() << std::endl;
	mystack->pop(elem);
	std::cout << elem << std::endl;
	std::cout << "length:" << mystack->stackLength() << std::endl;
	mystack->pop(elem);
	std::cout << elem << std::endl;
	std::cout << "length:" << mystack->stackLength() << std::endl;
	mystack->pop(elem);
	std::cout << elem << std::endl;
	std::cout << "length:" << mystack->stackLength() << std::endl;

	mystack->stackTraverse();

	std::cout << "length:" << mystack->stackLength() << std::endl;
	mystack->pop(elem);

	if (mystack->stackEmpty())
	{
		std::cout << "is empty" << std::endl;
	}
	mystack->stackTraverse();

	delete mystack;
	mystack = NULL;
	return 0;
}*/

// int main(int argc, char const *argv[])
// {
// 	MyStack *mystack = new MyStack(5);
// 	mystack->push(coordinate(1,2));
// 	mystack->push(coordinate(1,2));
// 	mystack->push(coordinate(1,2));
// 	mystack->push(coordinate(1,2));
// 	mystack->push(coordinate(1,2));
	

// 	if (mystack->stackFull())
// 	{
// 		std::cout << "is full" << std::endl;
// 	}

// 	mystack->stackTraverse();

// 	// coordinate *elem = new coordinate(1,1);
// 	// mystack->pop(elem);

// 	mystack->stackTraverse();


// 	if (mystack->stackEmpty())
// 	{
// 		std::cout << "is empty" << std::endl;
// 	}
// 	mystack->stackTraverse();

// 	delete mystack;
// 	mystack = NULL;
// 	return 0;
// }


void test_coordinate()
{
	MyStack<coordinate> *mystack = new MyStack<coordinate>(5);
	mystack->push(coordinate(1,2));
	mystack->push(coordinate(1,2));
	mystack->push(coordinate(1,2));
	mystack->push(coordinate(1,2));
	mystack->push(coordinate(1,2));
	

	if (mystack->stackFull())
	{
		std::cout << "is full" << std::endl;
	}

	mystack->stackTraverse(true);

	// coordinate *elem = new coordinate(1,1);
	// mystack->pop(elem);

	mystack->stackTraverse(true);


	if (mystack->stackEmpty())
	{
		std::cout << "is empty" << std::endl;
	}
	mystack->stackTraverse(true);

	delete mystack;
	mystack = NULL;
}

void test_char()
{
	MyStack<char> *mystack = new MyStack<char>(5);
	mystack->push('l');
	mystack->push('l');
	mystack->push('l');
	mystack->push('l');
	mystack->push('l');
	
	

	if (mystack->stackFull())
	{
		std::cout << "is full" << std::endl;
	}

	mystack->stackTraverse(true);

	// coordinate *elem = new coordinate(1,1);
	// mystack->pop(elem);

	mystack->stackTraverse(true);


	if (mystack->stackEmpty())
	{
		std::cout << "is empty" << std::endl;
	}
	mystack->stackTraverse(true);

	delete mystack;
	mystack = NULL;
}

int main(int argc, char const *argv[])
{
	test_char();	
	test_coordinate();
}